package main

import (
	"fmt"
	"io/ioutil"
)

func main() {
	// 将一个文件内容写入到另一个文件
	filePath := "d:/abc.txt"
	file2Path := "d:/abc2.txt"
	file, err1 := ioutil.ReadFile(filePath)
	if err1 != nil {
		fmt.Println("read file error", err1)
		return
	}
	err2 := ioutil.WriteFile(file2Path, file, 0666)
	if err2 != nil {
		fmt.Println("write file error", err1)
		return
	}
}
